import 'package:flutter/material.dart';
import 'package:flutter_rider/utils/screen_fit.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../../generated/r.dart';
import '../ext/u_text.dart';

class ImageInfoLayout extends StatelessWidget {
  ImageInfoLayout();

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.black,
      width: double.infinity,
      height: double.infinity,
      padding: EdgeInsets.all(16.rpx),
      child: Column(
        children: [
          const Spacer(),
          _renderItem(R.image_img_car, "车辆", "sc001"),
          14.hspace,
          _renderItem(R.image_img_date, "日期", "sc001"),
          14.hspace,
          _renderItem(R.image_img_time, "时间", "sc001"),
          14.hspace,
          _renderItem(R.image_img_location, "地点", "sc001"),
          14.hspace,
          _renderItem(R.image_img_latlng, "经纬", "sc001\r\nsc001"),
          14.hspace,
        ],
      ),
    );
  }

  Widget _renderItem(String img, String title, String value) {
    return Row(
      children: [
        Container(
          width: 76.rpx,
          height: 32.rpx,
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(16.rpx),
            border: Border.all(color: Colors.white, width: 1.rpx),
          ),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              SvgPicture.asset(img, width: 20.rpx, height: 20.rpx, color: Colors.white),
              3.wspace,
              UText.get(title, Colors.white, 14.rpx),
            ],
          ),
        ),
        10.wspace,
        UText.get(value, Colors.white, 14.rpx),
      ],
    );
  }
}
